<#-- @ftlvariable name="entity" type="com.xci.edu.core.entity.ExerciseQuestion" -->
<#-- @ftlvariable name="index" type="Integer" -->
<#-- @ftlvariable name="size" type="Integer" -->
<#-- @ftlvariable name="type" type="Integer" -->
<#-- @ftlvariable name="errorCount" type="Long" -->
<#-- @ftlvariable name="correctCount" type="Long" -->
<#include "/sys/_layout.ftl">
<#include "/foreground/pc/train/eduSimulatorExercise/questionType.ftl">
<div class="row" style="margin-top: 15px; margin-left: 15px;">

    <a class="btn btn-sm btn-default initQuestion <#if type==1>btn-primary</#if>" data-url="/train/simulatorExercise/seq">顺序出题</a>

    <a class="btn btn-sm btn-default initQuestion <#if type==2>btn-primary</#if>" data-url="/train/simulatorExercise/random" style="margin-left: 15px;">随机出题</a>
</div>
<div class="row" id="exercise_row" style="margin-top: 15px; margin-left: 15px; margin-right: 15px; border: 1px solid #cac8c9; padding: 20px;">
    <p class="exercise_title">${index+1}、${entity.title}</p>
    <div>
        <ul class="exercise_answer">
            <@questType model=entity/>
        </ul>
    </div>
    <div class="row" style="margin-top: 15px;">
        <div class="col-md-6">
            <#if entity.userSelected==null >
                <div class="fxhide" id="quest_result" data-url="/train/simulatorExercise/checkQuestion?questionId=${entity.id}">
                    您选择的答案：<span id="user_result" class="user_result"></span>
                    <a class="btn btn-success exercise_btn fxhide" id="answer_yes" style="width: 120px;">回答正确</a>
                    <a class="btn btn-danger exercise_btn fxhide" id="answer_no" style="width: 150px;">正确答案：${entity.answer}</a>
                </div>
            <#else>
                <div class="" id="quest_result" data-url="">
                    您选择的答案：<span id="user_result" class="user_result">${entity.userAnswer}</span>
                    <#if entity.userResult!=null && entity.userResult==true>
                        <a class="btn btn-success exercise_btn" id="answer_yes" style="width: 120px;">回答正确</a>
                    <#else>
                        <a class="btn btn-danger exercise_btn" id="answer_no" style="width: 150px;display: inline;">正确答案：${entity.answer}</a>
                    </#if>
                </div>
            </#if>
        </div>
        <div class="col-md-6 text-right" style="padding-right: 15px;">
            <@questOption model=entity/>
        </div>
    </div>
</div>
<div class="row" style="margin-top: 15px; margin-left: 15px;">
    <div class="col-md-6" style="font-size: 12px; line-height: 34px; padding-left: 0">
        共：<span id="total">${size}</span> 题
        答对：<span class="color-success">${errorCount}</span> 题
        答错：<span class="color-danger">${correctCount}</span> 题
    </div>
    <div class="col-md-6 text-right" style="padding-right: 30px;">
        <#if size&gt;0>
            <a class="btn btn-default favoriteQuestion <@IsPrimaryBtn isFavorite />"
               data-url="/train/simulatorExercise/favoriteQuestion?questionId=${entity.id}&favoriteType=2"
               data-favorite="${isFavorite}"><span class="fa fa-star"></span>
                <span>
                    <#if isFavorite>
                        已收藏
                    <#else>
                        收藏
                    </#if>
                </span>
            </a>
            <#if index-1&gt;-1>
                <a class="btn btn-default navQuestion" data-url="/train/simulatorExercise/getQuestion?index=${index-1}" style="margin-left: 15px;"><span class="fa fa-arrow-left"></span> 上一题</a>
            </#if>
            <#if index+1 < size>
                <a class="btn btn-default navQuestion" data-url="/train/simulatorExercise/getQuestion?index=${index+1}" style="margin-left: 15px;"><span class="fa fa-arrow-right"></span> 下一题</a>
            </#if>
        </#if>
    </div>
</div>
<input id="correctAnswer" type="hidden" value="${entity.answer}" />